package com.sss.security.config;

import com.sss.utils.MD5Util;
import org.springframework.security.crypto.password.PasswordEncoder;

public class PasswordEncoderImpl implements PasswordEncoder {
    @Override
    public String encode(CharSequence rawPassword) {
        return MD5Util.encode((String) rawPassword);
    }

    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        String encPassword = MD5Util.encode((String) rawPassword);
        boolean isok=       encodedPassword.equals(MD5Util.encode((String) rawPassword));
        return isok;
    }
}
